package com.base.app_core.util;

import android.widget.ImageView;

import com.bumptech.glide.Glide;

/**
 * Created by quantan.liu on 2017/3/1.
 */

public class ImageLoadUtils {

    /**
     * 首页热销列表图片
     */
    public static void showIndexImg(ImageView imageView, String url) {
        Glide.with(imageView.getContext())
                .load(url)
                .crossFade(500)
                .placeholder(getDefaultPic(0))
                .error(getDefaultPic(0))
                .into(imageView);
    }

    private static int getDefaultPic(int type) {
        return android.R.mipmap.sym_def_app_icon;
    }
}
